package com.linsir.lin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linsir.lin.mapper.RolePermissonMapper;
import com.linsir.lin.pojo.Role;
import com.linsir.lin.pojo.RolePermisson;
import com.linsir.lin.service.RolePermissonService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName:linsir-lin
 * @Package:com.linsir.lin.service
 * @Title: RolePermissonServiceImpl
 * @Description: TODO
 * @Create:2021/6/10 9:59 by @author:Linsir
 * @Update:2021/6/10 9:59 by @author:Linsir
 * @UpdateRemark: 初始创建
 * @Version 1.0.0
 */

@Service
public class RolePermissonServiceImpl extends ServiceImpl<RolePermissonMapper, RolePermisson> implements IService<RolePermisson> , RolePermissonService {
    /**
     * 根据角色找到角色和权限关系 对象列表
     *
     * @param role
     * @return
     */
    @Override
    public List<RolePermisson> rolePermissons(Role role) {
        QueryWrapper<RolePermisson> queryWrapper =new QueryWrapper<RolePermisson>();
        queryWrapper.eq("role_id",role.getId());
        return list(queryWrapper);
    }

}
